package com.foton.bpc.all.remoting.netty.channel.impl;

import com.foton.bpc.all.remoting.netty.channel.BpcChannel;
import io.netty.channel.Channel;

/**
 * @Author RenPu
 * @Date 2023/6/6 12:13
 * @Version 1.0
 * @Description:
 **/
public class NettyChannel implements BpcChannel {

    //Netty得Channel
   private Channel channel;

    public NettyChannel(Channel channel) {
        this.channel = channel;
    }

    /**
     * 底层依赖Netty得Channel，进行数据得发送
     * @param message
     */
    @Override
    public void send(byte[] message) {
        channel.writeAndFlush(message);
    }
}
